/**
 * SysRoleDaoImpl.java
 * Created at 2017-1-5
 * Created by xubin
 * Copyright (C) 2015 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.system.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.broadtext.common.exp.DaoException;
import com.broadtext.common.repository.EntityDao;
import com.broadtext.rms.system.dao.ISysRoleDao;
import com.broadtext.rms.system.model.SysRole;

/**
 * 
 * <p>ClassName: SysRoleDaoImpl</p>
 * <p>Description: 角色管理Dao</p>
 * <p>Author: shihui</p>
 * <p>Date: 2017-4-5</p>
 */
@Repository("sysRoleDao")
public class SysRoleDaoImpl extends EntityDao<SysRole> implements ISysRoleDao {
    
    /**
     * 
     * <p>
     * Description: 根据用户id获取用户所属部门信息
     * </p>
     * 
     * @param userId 用户ID
     * @return List<SysRole>
     * @throws DaoException daoException
     */
    @SuppressWarnings("unchecked")
    @Override
    public List<SysRole> selectRoleByUserId(String userId) throws DaoException {
        List<SysRole> list;
        list = new ArrayList<SysRole>();
        list = super.findByProperty("com.broadtext.rms.system.model.SysRole.selectRoleByUserId", userId);
        return list;
    }
}
